use std::ops::Mul;

/// 泛型函数
/// Rust 的函数也支持泛型。通过实现泛型函数，可以节省很多工作量
pub fn start() {
    let a = square(32, 446);
    let b = square(37.2, 12.8);
    println!("{} {}", a, b);
}

fn square<T: Mul<T, Output = T>>(t1: T, t2: T) -> T {
    t1 * t2
}
